#!/bin/bash

ACT=${1:-"start"}

set -x

echo "${ACT} obs api services ..."
systemctl ${ACT} obs-clockwork.service
systemctl ${ACT} obs-delayedjob-queue-consistency_check.service
systemctl ${ACT} obs-delayedjob-queue-default.service
systemctl ${ACT} obs-delayedjob-queue-issuetracking.service
systemctl ${ACT} obs-delayedjob-queue-mailers.service
systemctl ${ACT} obs-delayedjob-queue-project_log_rotate.service
systemctl ${ACT} obs-delayedjob-queue-releasetracking.service
systemctl ${ACT} obs-delayedjob-queue-staging.service
systemctl ${ACT} obs-sphinx.service

systemctl ${ACT} obs-api-support.target

echo "${ACT} obs source services ..."

systemctl ${ACT} obssrcserver.service
systemctl ${ACT} obsdeltastore.service
systemctl ${ACT} obsservicedispatch.service
systemctl ${ACT} obsservice.service

echo "${ACT} obs backend services ..."
systemctl ${ACT} obsrepserver.service
systemctl ${ACT} obsdodup.service
systemctl ${ACT} obsnotifyforward.service
systemctl ${ACT} obsscheduler.service
systemctl ${ACT} obsdispatcher.service
systemctl ${ACT} obspublisher.service
systemctl ${ACT} obssigner.service
systemctl ${ACT} obswarden.service
#systemctl ${ACT} obsgetbinariesproxy.service
